
<?php

// 激活状态修改
if(!empty($_GET['keys'])){

    $keys = $_GET['keys'];
    // 查询临时激活表中对应的数据，获取要激活的注册用户的id
    $active = getSelectByOne('active',"`keys_id`='$keys'");

    // 再判断激活链接是否在有效时间之内
    if(time()<$active['cookie_time']){
        $row = edit('menber',$active['menber_id'],array('active'=>1 ));
        if($row>0){
            $menber_id=$active['menber_id'];
            del('active',"`menber_id`='$menber_id'",true);
            echo"<script>alert('帐号激活成功！');location.href='http://localhost/cms/index.php?c=index&a=index';</script>";die;

        }else{
            echo"<script>alert('帐号激活失败！');history.go(-1)</script>";die;
        }
    }else{
        echo"<script>alert('您的激活链接已超过有效时限');history.go(-1)</script>";die;
    }
}else{
    echo"<script>alert('非法操作！');location.href='http://www.4399.com';</script>";die;
}

?>

